﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EPiServer.Personalization.VisitorGroups;
using System.ComponentModel.DataAnnotations;
using EPiServer.Web.Mvc.VisitorGroups;

namespace CriteriaPack.IPRangeCriterion
{
    public class IPRangeModel : CriterionModelBase
    {
        [DojoWidget(
            SelectionFactoryType = typeof(EnumSelectionFactory),
            AdditionalOptions = "{ selectOnClick: true }"),
            Required]
        public IPCompareCondition Condition { get; set; }

        [DojoWidget(
            AdditionalOptions = "{ selectOnClick: true }"),
            Required]
        public string IP { get; set; }

        public override ICriterionModel Copy()
        {
            return base.ShallowCopy();
        }
    }

    public enum IPCompareCondition
    {
        Equal,
        GT,
        LT
    }
}
